package com.cloudcross.ssp.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloudcross.ssp.base.dao.GenericIBatisDao;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.rpt.LocationRpt;
import com.cloudcross.ssp.model.rpt.Report;
import com.cloudcross.ssp.service.IRptLocationService;

@Service
public class RptLocationService implements IRptLocationService{
	
	@Autowired
	private GenericIBatisDao myBatisDao;
	
	@Override
	public List<LocationRpt> queryLocationDataByCondition(Map<String, Object> condition, Pager pager) {
		String namespace = "";
		if (pager == null) {
			namespace = "rptSqlMapper.queryLocationExcelByCondition";
		} else {
			condition.put("pager", pager);
			namespace = "rptSqlMapper.queryLocationByCondition";
		}
		return myBatisDao.getList(namespace, condition);
	}

	@Override
	public int queryLocationCountByCondition(Map<String, Object> condition) {
		return myBatisDao.get("rptSqlMapper.queryLocationCountByCondition", condition);
	}

	@Override
	public Report queryLocationTotalByCondition(Map<String, Object> condition) {
		return myBatisDao.get("rptSqlMapper.queryLocationTotalByCondition", condition);
	}

}
